package com.hundsun.yr.universal.p2p.bean;

import java.math.BigDecimal;

import android.text.TextUtils;

import com.hundsun.yr.universal.p2p.utils.CommTool;

/**
 * 借款人基本信息
 * 
 * @author tonglj
 * 
 */
public class BorrowerPersonalInfo {
	private String sex;
	private int age;
	private String merryState;
	private String hasHouse;
	private String hasCar;
	private String mobile;
	
	
	
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}


	/**身份证号**/
	private String certNo;
	
	
	
	public String getCertNo() {
		return certNo;
	}

	public void setCertNo(String certNo) {
		this.certNo = certNo;
	}


	/**
	 * 平台总额度
	 */
	private BigDecimal creditAmount;
	/**
	 * 融资方类型
	 */
	private String userType;

	public String getSex() {
		if (TextUtils.equals(sex, "FEMALE")) {
			return "女";
		} else if (TextUtils.equals(sex, "MALE")) {
			return "男";
		} else if (TextUtils.equals(sex, "SECRET")) {
			return "保密";
		}
		return "";
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getMerryState() {
		String result = "";
		if (TextUtils.equals("MARRIED", merryState)) {
			result = "已婚";
		} else if (TextUtils.equals("UNMARRIED", merryState)) {
			result = "未婚";
		} else if ("DISSOCIATION".equals(merryState)) {
			result = "离异";
		} else if ("WIDOWED".equals(merryState)) {
			result = "丧偶";
		} else if ("SECRECY".equals(merryState)) {
			result = "保密";
		}
		return result;
	}

	public void setMerryState(String merryState) {

		this.merryState = merryState;
	}

	public String getHasHouse() {
		if ("YES".equals(hasHouse)) {
			return "已提供";
		} else {
			return "未提供";
		}
	}

	public void setHasHouse(String hasHouse) {
		this.hasHouse = hasHouse;
	}

	public String getHasCar() {
		if ("YES".equals(hasCar)) {
			return "已提供";
		} else {
			return "未提供";
		}
	}

	public void setHasCar(String hasCar) {
		this.hasCar = hasCar;
	}

	public String getUserType() {
		String result = "";
		if ("PERSONAL".equals(userType)) {
			result = "个人会员";
		} else if ("COMPANY".equals(userType)) {
			result = "机构会员";
		}
		return result;
	}

	public void setUserType(String userType) {

		this.userType = userType;
	}

	public String getCreditAmount() {
		if (creditAmount != null) {
			return CommTool.roundingAmount(creditAmount);
		} else {
			return "";
		}
	}

	public void setCreditAmount(BigDecimal creditAmount) {
		this.creditAmount = creditAmount;
	}
	
	
	/**
	 * 显示性别(身份证判断)
	 * @return
	 */
	public String displaySex(){
		String sex="男";
		if(TextUtils.equals("FEMALE", CommTool.getSexByCertNo(certNo))){
			sex="女";
		}else{
			sex="男 ";
		}
		return sex;
		
	}

}
